package com.example.dto.request.user;

import com.example.dto.request.group.InsertGroup;
import com.example.validator.constraints.FileCount;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.springframework.web.multipart.MultipartFile;

import javax.validation.constraints.NotNull;

/**
 * @author LeXin Huang
 * @date 2021年03月24日 16:02
 */
@Data
public class CommunityDynamicRequestDTO {
    @FileCount(max = 6, message = "单次动态最多只能上传6张图片!", groups = {InsertGroup.class})
    @ApiModelProperty(value = "上传的图片(可以不上传, 最多上传 6 张)")
    private MultipartFile[] pictures;

    @NotNull(message = "缺少话题标签参数!", groups = {InsertGroup.class})
    @Length(max = 60, message = "话题标签必须在 60 个字符内!", groups = {InsertGroup.class})
    @ApiModelProperty(value = "话题标签(没有选择标签时, 请将值设置为空字符串)")
    private String topic;

    @NotNull(message = "缺少动态内容参数!", groups = {InsertGroup.class})
    @Length(min = 1, message = "动态内容不能为空!", groups = {InsertGroup.class})
    @Length(max = 500, message = "您输入的内容太多了, 请减少后再试!", groups = {InsertGroup.class})
    @ApiModelProperty(value = "动态内容")
    private String content;
}
